package cn.virens.common.boot.dubbo.consumer.beetl.format;

import cn.virens.common.util.exception.APIException;
import org.beetl.core.Format;
import org.dromara.hutool.core.codec.binary.Base64;

public class Base64Format implements Format {

    @Override
    public Object format(Object data, String pattern) throws APIException {
        return data != null ? Base64.encode(data.toString()) : "";
    }

}
